package com.xs.arraylist.movie;

import com.xs.arraylist.movie.impl.Movie;

import java.util.ArrayList;

public class ArrayList04 {
    public static void main(String[] args) {
        Movie m1=new Movie("《残烟记》",9.6,"李鸿辉");
        Movie m2=new Movie("《残烟记2》",9.9,"李鸿辉");
        Movie m3=new Movie("《残烟记3》",8.7,"李鸿辉");
        ArrayList<Movie> ary=new ArrayList<>();
        ary.add(m1);
        ary.add(m2);
        ary.add(m3);
        System.out.println(ary);//存储的是元素的地址所以是一串字符
        for (int i = 0; i < ary.size(); i++) {
            Movie movie=ary.get(i);
            System.out.println("电影名："+movie.getName());
            System.out.println("评分："+movie.getTime());
            System.out.println("主演："+movie.getZhuyan());
            System.out.println("---------------------------------------------");
        }

    }
}
